/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

const rootUrl = 'http://200.144.81.45:8081/asfd/';

export default class CockpitPost extends Component {
    constructor(props) {  
        super(props);
    }

    //登录接口
    mobileLogin(params) {  
        return fetch(rootUrl + 'login/login!mobileLogin.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }

    //密码修改接口
    updateMobilePwd(params) {
        return fetch(rootUrl + 'user/user!updateMobilePwd.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }
    
    //版本更新
    versionCheck(params) {
        return fetch(rootUrl + 'version/version!latestVersionInfo.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }
  
    //指标大类查询
    queryIndType(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind!queryIndType.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }

    //指标小类查询
    queryIndConfigByTypeId(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind!queryIndConfigByTypeId.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }
    
    //报表查询
    cockpitReport(params) {
        return fetch(rootUrl + 'cockpit/cockpit-report!cockpitReport.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }

    //机构列表查询
    queryReportOrg(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!queryReportOrg.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }
    
    //个人的指标配置查询
    queryUserAllConfig(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!queryUserAllConfig.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }
    
    //个人的指标root配置查询
    getUserCindConfigRootList(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!getUserCindConfigRootList.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }

    //大类删除
    deleteUserCindConfigRoot(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!deleteUserCindConfigRoot.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }

    //小类删除
    deleteUserCindConfig(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!deleteUserCindConfig.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }


    //大类增加
    addUserCindRootConfig(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!addUserCindRootConfig.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }


    //小类增加
    addUserCindConfig(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!addUserCindConfig.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }


    //大类名称修改
    updateUserCindRootConfig(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!updateUserCindRootConfig.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }


    //小类名称修改
    updateUserCindConfig(params) {
        return fetch(rootUrl + 'cockpit/cockpit-ind-user!updateUserCindConfig.action?channel=cockpit', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(params)
        })
    }




    render() {
        return (
            <View style={styles.container} >
            
            </View>
        );
    }

}

const styles = StyleSheet.create({
    container: {
        flex: 1
    }
});
